home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 663 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: clamage@Eng.Sun.COM (Steve Clamage)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: #endif //
  5. Date: 06 Mar 1996 13:56:31 PST
  6. Organization: Sun Microsystems Inc.
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4hl104$mrc@engnews1.Eng.Sun.COM>
  9. References: <r4lolec6xs.fsf@erawan.cognex.com>
  10. Reply-To: clamage@Eng.Sun.COM
  11. NNTP-Posting-Host: isolde.mti.sgi.com
  12. X-Original-Date: 6 Mar 1996 21:44:36 GMT
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMT4KJky4NqrwXLNJAQH0FAIAqG/2D+cUFuvLt3zimggMMqCnFCQ4L6TG
  15.     nXT60WqcH/w+NRD0tIOBSx2TO4WQJwQ8t/8pM/jEkZpetjv8wep9QQ==
  16.     =AY4C
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. In article fsf@erawan.cognex.com, Michael Cook <mcook@cognex.com> writes:
  20. >Is it legal to have //-style comments within a preprocessor directive?
  21.  
  22. Yes.
  23.  
  24. >  If so,
  25. >that'd mean C++ compilers would be precluded from using ISO C preprocessors.
  26.  
  27. Preprocessing is not a separate translation step according to the C and
  28. C++ language definitions. The preprocessing need not be an identifiable
  29. step, nor is there any requirement to provide preprocessed output.
  30.  
  31. If an implementation chooses to make preprocessing a separate step (or
  32. a separable step) it may do so. The preprocessing rules for C and C++ are 
  33. not quite the same, due to //-comments in C++, so a shared preprocessor
  34. would have to take that into account. Such shared preprocessors typically
  35. take a command-line flag to say whether it is dealing with C or C++ code.
  36.  
  37. C will almost certainly adopt //-comments, and some C compilers currently
  38. accept them anyway. Thus, the point will soon be moot.
  39.  
  40. ---
  41. Steve Clamage, stephen.clamage@eng.sun.com
  42. ---
  43. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  44.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  45.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  46.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  47.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  48. ]
  49.